@echo off
echo ========================================
echo 调试搜索功能问题
echo ========================================

echo.
echo 1. 检查后端服务状态...
netstat -an | findstr :8080
if %errorlevel% neq 0 (
    echo 后端服务未运行，请先启动后端服务
    pause
    exit /b 1
)

echo.
echo 2. 测试具体搜索条件...
echo 测试护理员=user07的查询...
curl -X GET "http://localhost:8080/system/arrangement/joinList?pageNum=1&pageSize=10&caregiver_name=user07"

echo.
echo 3. 测试护理项目=助餐的查询...
curl -X GET "http://localhost:8080/system/arrangement/joinList?pageNum=1&pageSize=10&nursing_item_name=助餐"

echo.
echo 4. 测试组合查询（护理员+护理项目）...
curl -X GET "http://localhost:8080/system/arrangement/joinList?pageNum=1&pageSize=10&caregiver_name=user07&nursing_item_name=助餐"

echo.
echo 5. 测试状态筛选...
curl -X GET "http://localhost:8080/system/arrangement/joinList?pageNum=1&pageSize=10&status=待执行"

echo.
echo 6. 测试完整组合查询...
curl -X GET "http://localhost:8080/system/arrangement/joinList?pageNum=1&pageSize=10&caregiver_name=user07&nursing_item_name=助餐&status=待执行&beginTime=2025-09-04&endTime=2025-10-31"

echo.
echo 测试完成！
echo 如果组合查询返回空结果，说明数据中确实没有同时满足所有条件的记录
echo 如果返回了不匹配的结果，说明SQL逻辑有问题
pause
